Question: Let $a$ and $b$ be the roots of the equation $x^2-mx+2=0$. Suppose that $a + \frac{1}{b}$ and $b + \frac{1}{a}$ are the roots of the equation $x^2-px+q=0$. What is $q$?
Solution: By Vieta's formulas, $ab = 2.$  Then
\[q = \left( a + \frac{1}{b} \right) \left( b + \frac{1}{a} \right) = ab + 1 + 1 + \frac{1}{ab} = 2 + 1 + 1 + \frac{1}{2} = \boxed{\frac{9}{2}}.\]